#include<cstdio>//uncle-lu
#include<vector>
#include<algorithm>
template<class T>void read(T &x)
{
	x=0;int f=0;char ch=getchar();
	while(ch<'0'||ch>'9') { f|=(ch=='-'); ch=getchar(); }
	while(ch<='9'&&ch>='0') { x=(x<<1)+(x<<3)+(ch^48); ch=getchar(); }
	x = f ? -x : x;
	return ;
}

int n;
std::vector<int>edge[1510];
int F[1510][2];

void DFS(int x, int fa)
{
	F[x][1] = 1;
	for (int i =  0; i < (int)edge[x].size(); i++) 
	{
		int v = edge[x][i];
		if(v == fa)continue;
		DFS(v, x);
		F[x][1] += std::min(F[v][1], F[v][0]);
		F[x][0] += F[v][1];
	}

	return ;
}

int main()
{
	read(n);
	int x, k, temp;
	for (int i = 1; i <= n; i++) 
	{
		read(x);read(k);
		for (int j = 1; j <= k; j++) 
		{
			read(temp);
			edge[x].push_back(temp);
			edge[temp].push_back(x);
		}
	}

	DFS(0, -1);

	printf("%d", std::min(F[0][0], F[0][1]));

	return 0;
}
